package com.fast.framework.core.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fast.framework.core.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 菜单信息表
 * </p>
 *
 * @author lanyuankeji
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_menu")
@ApiModel(value = "Menu对象", description = "菜单信息表")
public class Menu extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "菜单ID")
    @TableId("menu_id")
    private String menuId;

    @ApiModelProperty(value = "url(访问)")
    @TableField("url")
    private String url;

    @ApiModelProperty(value = "path(路由)")
    @TableField("path")
    private String path;

    @ApiModelProperty(value = "组件名称")
    @TableField("component")
    private String component;

    @ApiModelProperty(value = "菜单名")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "图标")
    @TableField("iconCls")
    private String iconCls;

    @ApiModelProperty(value = "是否保持激活")
    @TableField("keepAlive")
    private Boolean keepAlive;

    @ApiModelProperty(value = "是否要求权限")
    @TableField("requireAuth")
    private Boolean requireAuth;

    @ApiModelProperty(value = "父ID")
    @TableField("parent_id")
    private String parentId;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(value = "1:组件菜单，2:功能")
    @TableField("flag")
    private String flag;

    @ApiModelProperty("子菜单")
    @TableField(exist = false)
    private List<Menu> children;

    //哪些角色拥有这个权限
    @TableField(exist = false)
    private List<Role> roles;

}
